import Vue from 'vue'
import store from '../store';
import http from '../api/api.js'

// 全局vuex使用
Vue.prototype.$store = store;
// 全局请求
Vue.prototype.$http = http

// 统一成功失败提示
Vue.prototype.$toast = (title, duration = 1500) => uni.showToast({
	icon: 'none',
	title,
	duration
})

Vue.prototype.$router = (url, type = 'navigateTo', animationType = 'slide-in-left') => uni[type]({
	url,
	animationType,
	animationDuration: 800
})

Vue.prototype.$switchTab = (url) => uni.switchTab({
	url
})

Vue.prototype.$relaunch = (url) => uni.reLaunch({
	url
})